package com.bdqn.service;

import com.bdqn.mapper.RoomTypeMapper;
import com.bdqn.pojo.RoomType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service("roomTypeService")
public class RoomTypeServiceImpl implements RoomTypeService{
    @Resource
    private RoomTypeMapper roomTypeMapper;
    @Override
    public List<RoomType> findList(Map<String, Object> queryMap) {
        return roomTypeMapper.findList(queryMap);
    }

    @Override
    public RoomType selectRoot(Long id) {
        return roomTypeMapper.selectRoot(id);
    }

    @Override
    public List<RoomType> list() {
        return roomTypeMapper.list();
    }
    @Override
    public RoomType getroom(Long id) {
        return roomTypeMapper.getroom(id);
    }

    /**
     * 分页查询房间信息
     * @param queryMap
     * @return
     */
    @Override
    public List<RoomType> getList(Map<String, Object> queryMap) {
        return roomTypeMapper.getList(queryMap);
    }

    @Override
    public int getTotal(Map<String, Object> queryMap) {
        return roomTypeMapper.getTotal(queryMap);
    }


    /**
     * 添加房间信息
     * @param roomType
     * @return
     */
    @Override
    public int add(RoomType roomType) {
        return roomTypeMapper.add(roomType);
    }

    /**
     * 根据id删除房间信息
     * @param id
     * @return
     */
    @Override
    public int delete(Long id) {
        return roomTypeMapper.delete(id);
    }

    /**
     * 修改房间类型信息
     * @param roomType
     * @return
     */
    @Override
    public int edit(RoomType roomType) {
        return roomTypeMapper.edit(roomType);
    }

    /**
     * 获取单个房间信息
     * @param id
     * @return
     */
    @Override
    public RoomType find(Long id) {
        return roomTypeMapper.find(id);
    }

    @Override
    public List<RoomType> findAll() {
        return roomTypeMapper.findAll();
    }

    public int updateNum(RoomType roomType) {
        // TODO Auto-generated method stub
        return roomTypeMapper.updateNum(roomType);
    }
}
